package com.example.wechat.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.project.entity.User;
import com.example.wechat.mapper.WechatUserContactMapper;
import com.example.wechat.model.WechatUserContact;

/**
 * 用户好友关系Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-12
 */
@Service
public class WechatUserContactService {

	@Autowired
	private WechatUserContactMapper wechatUserContactMapper;

	public WechatUserContact checkStatus(long userId, long contactId) {
		// TODO Auto-generated method stub
		return wechatUserContactMapper.queryByUserIdAndContactId(userId, contactId);
	}

	public WechatUserContact insert(User user, User contactUserInfo) {
		// TODO Auto-generated method stub
		WechatUserContact info = new WechatUserContact();
		info.setUserId(user.getUserId());
		info.setContactId(contactUserInfo.getUserId());
		info.setRemarkName(contactUserInfo.getUserName());
		info.setRelationStatus(1);
		wechatUserContactMapper.insert(info);
		return info;
	}

}
